import json

# str1 = '{"one": 1, "two":2}'
# print(type(str1))
# dic1 = json.loads(str1)
# print(type(dic1))
#
# dic1["名字"] = '坚果'
# print(dic1)
# # str2 = json.dumps(dic1, ensure_ascii=False)
# # print(type(str2))
# # print(str2)
# json.dump(dic1, open('my_test.txt', 'a+', encoding='utf-8'), ensure_ascii=False)

dic2 = json.load(open('my_test.txt', 'r', encoding='utf-8'))
print(type(dic2))
print(dic2)